<?php
/**
 * Main index page
 * @author  DatNgo <nhdat.itec@gmail.com>
 * @created_at  29 Jun, 2013
 * @updated     <name>
 * @updated_at  <time>
 */
?>
<?php
$this->layout = 'metro';
Yii::app()->getClientScript()->registerScript('fbsocial',"
    (function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = \"//connect.facebook.net/vi_VN/all.js#xfbml=1&status=0\";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
", CClientScript::POS_BEGIN);
?>

<section id="content" class="clearfix top">

<!-- BEGIN LEFT CONTENT -->
<section id="gametile-left">

<?php $this->renderPartial('_banner'); ?>

<div id="loader"></div><!-- loader image for AJAX -->
<!-- Title --><div id="content-title"><?php echo Yii::t('main', 'game.list'); ?></div>
<div id="blogs" class="clearfix centered">
<!-- Game: Chinese Chess -->
    <div class="tile medium">
        <div class="tile-title"><span class="bl-title"><?php echo Yii::t('main', 'implementing'); ?><br/><?php echo Yii::t('main', 'comeback_later'); ?></span></div>
        <img class="tile-pre-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/chinese_chess.png" alt="<?php echo Yii::t('main', 'game.chinese_chess'); ?>" />
        <span class="tile-cat lime"><?php echo Yii::t('main', 'game.chinese_chess'); ?></span>
    </div>
<!-- Game: Chess -->
    <div class="tile medium live" data-mode="flip" data-speed="500" data-delay="4500">
        <div class="tile-title">
            <span class="bl-title-top">
                <span class="text"><?php echo Yii::t('main', 'playing',array('{num}'=>62)); ?></span>
                <span class="control">
                    <a class="btn btn-trans btn-small" href="<?php echo $this->createUrl('help/play', array('game'=>'covua')); ?>"><?php echo Yii::t('main', 'btn.help'); ?></a>
                    <a class="btn btn-primary btn-small" href="#"><?php echo Yii::t('main', 'btn.play'); ?></a>
                </span>
            </span>
        </div>
        <div class="live-front">
            <img class="live-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/chess_front.png" alt="<?php echo Yii::t('main', 'game.chess'); ?>" />
        </div>
        <div class="live-back">
            <img class="live-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/chess_back.png" alt="<?php echo Yii::t('main', 'game.chess'); ?>" />
        </div>
        <span class="tile-cat teal"><?php echo Yii::t('main', 'game.chess'); ?></span>
    </div>
<!-- Game: TienLen -->
    <div class="tile medium live" data-mode="carousel"  data-direction="horizontal" data-delay="3000">
        <div class="tile-title"><span class="bl-title"><?php echo Yii::t('main', 'implementing'); ?><br/><?php echo Yii::t('main', 'comeback_later'); ?></span></div>
        <div class="live-front">
            <img class="tile-pre-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/tienlen_front.png" alt="<?php echo Yii::t('main', 'game.tienlen'); ?>" />
        </div>
        <div class="live-back">
            <img class="tile-pre-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/tienlen_back.png" alt="<?php echo Yii::t('main', 'game.tienlen'); ?>" />
        </div>
        <span class="tile-cat purple"><?php echo Yii::t('main', 'game.tienlen'); ?></span>
    </div>
<!-- Game: Phom -->
    <div class="tile medium">
        <div class="tile-title"><span class="bl-title"><?php echo Yii::t('main', 'implementing'); ?><br/><?php echo Yii::t('main', 'comeback_later'); ?></span></div>
        <img class="tile-pre-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/phom_front.png" alt="Article 6" />
        <span class="tile-cat red"><?php echo Yii::t('main', 'game.phom'); ?></span>
    </div>
<!-- Game: 3La -->
    <div class="tile medium live" data-mode="carousel" data-direction="horizontal" data-speed="750" data-delay="3000">
        <div class="tile-title">
            <span class="bl-title-top">
                <span class="text"><?php echo Yii::t('main', 'playing',array('{num}'=>47)); ?></span>
                <span class="control">
                    <a class="btn btn-trans btn-small" href="<?php echo $this->createUrl('help/play', array('game'=>'3la')); ?>"><?php echo Yii::t('main', 'btn.help'); ?></a>
                    <a class="btn btn-primary btn-small" href="#"><?php echo Yii::t('main', 'btn.play'); ?></a>
                </span>
            </span>
        </div>
        <div class="live-front">
            <img class="live-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/3la_front.png" alt="Flip" />
        </div>
        <span class="tile-cat mango"><?php echo Yii::t('main', 'game.3la'); ?></span>
    </div>
<!-- Game: Poker -->
    <div class="tile medium live" data-stops="100%,0" data-speed="1000" data-delay="3500" data-direction="horizontal" data-stack="true">
        <div class="tile-title">
            <span class="bl-title-top">
                <span class="text"><?php echo Yii::t('main', 'playing',array('{num}'=>83)); ?></span>
                <span class="control">
                    <a class="btn btn-trans btn-small" href="<?php echo $this->createUrl('help/play', array('game'=>'xito')); ?>"><?php echo Yii::t('main', 'btn.help'); ?></a>
                    <a class="btn btn-primary btn-small" href="#"><?php echo Yii::t('main', 'btn.play'); ?></a>
                </span>
            </span>
        </div>
        <div class="live-front">
            <img class="live-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/poker_new_2.png" alt="<?php echo Yii::t('main', 'game.poker'); ?>"/>
        </div>
        <div class="live-back">
            <img class="live-img" src="<?php echo Yii::app()->request->baseUrl; ?>/images/games/poker_new_1.png" alt="<?php echo Yii::t('main', 'game.poker'); ?>"/>
        </div>
        <span class="tile-cat blue"><?php echo Yii::t('main', 'game.poker'); ?></span>
    </div>
</div><!-- end #blogs -->

<!-- Title --><div class="sub-title"><?php echo Yii::t('main', 'title.followfb', array('{name}' => Yii::app()->name)); ?></div>
<div class="followfb white">
<div class="fb-like-box" data-href="https://www.facebook.com/gameonline.web" data-width="630" data-height="210" data-show-faces="true" data-stream="true" data-show-border="false" data-header="false"></div>
</div>
</section>
<!-- END LEFT CONTENT -->
<!-- BEGIN SIDEBAR -->
<section id="sidebar">

<!-- <div id="search" class="widget">
<form action=" ">
<input id="search-field" type="search" name="sitesearch" class="placeholder" placeholder="Search" />
<input type="submit" id="search-submit" value=" " />
</form>
</div> -->

<div class="widget text-widget white">
<h5><?php echo Yii::t('main', 'sidebar.account');?></h5>
    <?php if(Yii::app()->user->isGuest){ ?>
    <div class="box">
        <?php $form = $this->beginWidget('CActiveForm', array(
            'id' => 'login-form',
            'action' => $this->createUrl('user/login'),
            'htmlOptions' => array(
                'class'=>'text-centered',
            )
        )); ?>
        <div class="control-group">
            <div class="control"><?php echo $form->textField($loginForm, 'username', array('placeholder'=>Yii::t('main', 'holder.username')) ); ?></div>
        </div>
        <div class="control-group">
            <div class="control"><?php echo $form->passwordField($loginForm, 'password', array('placeholder'=>Yii::t('main', 'holder.password')) ); ?></div>
        </div>
        <div class="control-group centered_lr" style="width:150px">
            <div class="control"><label class="checkbox">
                <input type="checkbox" value="1" name="keep_login">
                <?php echo Yii::t('main', 'chb.autologin'); ?>
              </label></div>
        </div>
        <div class="control-group">
            <button type='submit' class="btn btn-primary"><?php echo Yii::t('main', 'btn.login'); ?></button>
            <a class="btn testcolor" href="<?php echo $this->createUrl('user/forgotpassword');?>"><?php echo Yii::t('main', 'btn.forgot_pwd'); ?></a>
        </div>
        <div class="control-group">
            <div class="control">
                <a href="<?php echo $this->createUrl('user/create');?>"><?php echo Yii::t('main', 'link.register'); ?></a>
            </div>
        </div>
        <?php $this->endWidget(); ?>
        <div class="text-right">
            <?php
                $this->widget('ext.eauth.EAuthWidget', array('action' => 'user/login'));
            ?>
            <div class="text-inline"><?php echo Yii::t('main', 'login_by'); ?></div>
            <span class="auth-service google">
                <a href="<?php echo Yii::app()->createUrl('user/login',array('service' => 'google'))?>"><span class="google-mini"></span></a>
            </span>
            <span class="auth-service facebook">
                <a href="<?php echo Yii::app()->createUrl('user/login',array('service' => 'facebook'))?>"><span class="facebook-mini"></span></a>
            </span>
            <span class="auth-service twitter">
                <a href="<?php echo Yii::app()->createUrl('user/login',array('service' => 'twitter'))?>" class=""><span class="twitter-mini"></span></a>
            </span>
        </div>
    </div>
    <?php }else{ ?>
    <div class="box-wide">
        <table class="info-tbl">
            <tr>
                <td rowspan="4" class="avatar-cell"><img class="avatar-small" src=""></td>
            </tr>
            <tr>
                <td><?php echo Yii::t('main', 'hello'); ?>&nbsp;
                    <a href="#" title="<?php echo Yii::t('main', 'title.profile'); ?>"><?php echo Yii::app()->user->name;?></a>
                </td>
            </tr>
            <tr>
                <td><?php echo Yii::t('main', 'coin'); ?>: <?php echo $this->curr_user->amount;?></td>
            </tr>
            <tr>
                <td><?php echo Yii::t('main', 'last_visit'); ?>: hum wa</td>
            </tr>
        </table>
        <div class="text-centered">
            <a class="btn btn-warning" href="<?php echo $this->createUrl('bank/transfer');?>"><?php echo Yii::t('main', 'transfer_coin'); ?></a>
            <a class="btn btn-primary" href="<?php echo $this->createUrl('bank/listDeposits');?>"><?php echo Yii::t('main', 'btn.add_coin'); ?></a>
            <a class="btn" href="<?php echo $this->createUrl('user/logout');?>"><?php echo Yii::t('main', 'btn.logout'); ?></a>
        </div>
    </div>
    <?php } ?>
</div><!-- end .text-widget (account)-->

<div class="widget text-widget white">
<h5><?php echo Yii::t('main', 'sidebar.topten');?></h5>
<div class="box-wide">
    <?php $this->renderPartial('_top_money'); ?>
</div>
</div><!-- end .text-widget (topten)-->

<div id="recent-box" class="widget">
<h5><?php echo Yii::t('main', 'sidebar.event');?></h5>
<ul class="articles-widget">
<li>
    <a href="http://error404.000webhost.com/?">
    <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/pages/event-1.png" alt="Event 1" />
    <div class="title">Giải đấu Poker tài năng toàn quốc<br><span class="redtxt">News</span></div>
    <div class="more"></div>
    </a>
</li>
<li>
    <a href="http://error404.000webhost.com/?">
    <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/pages/event-2.png" alt="Event 2" />
    <div class="title">Quà tặng tân thủ - Thêm quà thêm vui<br><span class="limetxt">News</span></div>
    <div class="more"></div>
    </a>
</li>
<li>
    <a href="http://error404.000webhost.com/?">
    <img src="<?php echo Yii::app()->request->baseUrl; ?>/images/pages/event-3.png" alt="Event 3" />
    <div class="title">Khuyến mãi nhân đôi thẻ nạp<br><span class="tealtxt">Event</span></div>
    <div class="more"></div>
    </a>
</li>
</ul>
</div><!-- end #recent-box -->

</section>
</section>